<template>
	<view class="container page">
		<Header :isBack="true">
			<block slot="content">{{title}}</block>
		</Header>
		<view class="" style="padding:10rpx 20rpx;">
			<rich-text :nodes="info.content"></rich-text>
			<view class="know" @tap="goLogin" v-show="isShow">
				我已知晓并同意
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				title: '服务协议',
				info: {},
				isShow: false
			};
		},
		onLoad(option) {
			this.loadData();
		},
		methods: {
			async loadData() {
				let res = await this.$myRequest({
					url: '/getAgreement',
					data: {
						type: 'zhgx-service-contract'
					},
				})
			
				this.info = res.data.data;
				this.isShow = true;
			},
			
			goLogin() {
				uni.navigateBack()
			}
		}
	}
</script>
<style>
	page {
		background-color: #f7f7f7;
		font-size: $uni-font-size-base;
	}
</style>
<style lang='scss'>
	.container {
		// #ifdef APP-PLUS
		padding-top: 160rpx;
		// #endif

		// #ifdef H5
		padding-top: 100rpx;
		// #endif

		// #ifdef MP-WEIXIN
		padding-top: 165rpx;
		// #endif
	}

	.text {
		font-size: 28upx;
		margin-top: 14upx;
		color: #333
	}

	.know {
		width: 100%;
		background-color: $uni-text-color;
		color: #fff;
		height: 40px;
		line-height: 40px;
		border-radius: 10upx;
		text-align: center;
		font-size: $uni-font-size-base;
		margin: 10upx 0 20upx;
		letter-spacing: 2upx;
	}
</style>
